pkg_name=xloadimage
version=4.1
patch_lvl=23
build_dir=$builds_dir_root/$pkg_name-$version
src_dir=$src_dir_root/$pkg_name.$version
#we use the debian version, which is quite beefed up
url0=http://ftp.de.debian.org/debian/pool/main/x/$pkg_name/${pkg_name}_$version.orig.tar.gz
url1=http://ftp.de.debian.org/debian/pool/main/x/$pkg_name/${pkg_name}_$version-$patch_lvl.debian.tar.xz

cd "$src_dir_root"
rm -Rf "$pkg_name.$version"
tar zxf "${pkg_name}_$version.orig.tar.gz"
tar Jxf "${pkg_name}_$version-$patch_lvl.debian.tar.xz"
for p in $(cat "$src_dir_root/debian/patches/series")
do
    patch -d "$src_dir" -p 1 -N -i "$src_dir_root/debian/patches/$p"
done

exit

rm -Rf "$build_dir"
mkdir -p "$build_dir"
cd "$build_dir"

export CFLAGS=-O0
"$src_dir/configure"			\
	--prefix=			\
	--enable-nls			\
	--disable-rpath			\
	--enable-fallback=procmail	\
	--disable-POP2			\
	--disable-IMAP			\
	--enable-ETRN			\
	--enable-ODMR			\
	--disable-RPA			\
	--disable-NTLM			\
	--disable-SDPS			\
	--with-gnu-ld			\
	--without-ssl
unset CFLAGS

make

install_tmp_dir=/tmp/$pkg_name-$version
rm -Rf "$install_tmp_dir"
mkdir -p "$install_tmp_dir"
make install "DESTDIR=$install_tmp_dir"

install_dirs "$builders_dir_root/$pkg_name/runtime.dirs"
install_files "$builders_dir_root/$pkg_name/runtime.files" "$install_tmp_dir"
elf_strip "$builders_dir_root/$pkg_name/elf-strip"

rm -Rf "$install_tmp_dir"
rm -Rf "$build_dir"
rm -Rf "$src_dir"
rm -Rf "$src_dir_root/debian"
